gtk-demo: Fix drawing of gestures demo feedback on CSD windows
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 15 Sep 2015 11:19:31 +0000 (13:19 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 15 Sep 2015 11:23:53 +0000 (13:23 +0200)
It was wiping the translation initially applied to the cairo_t, so
pick that up first before applying our own matrix changes.

demos/gtk-demo/gestures.c

index b5a29583c22ec7303af2ad31876bf2a82022e900..f8e475817d2d74aefc056d1da58f1cc04dd1b7d6 100644 (file)
@@ -86,9 +86,10 @@ drawing_area_draw (GtkWidget *widget,
       cairo_matrix_t matrix;
       gdouble angle, scale;
 
-      cairo_matrix_init_translate (&matrix,
-                                   allocation.width / 2,
-                                   allocation.height / 2);
+      cairo_get_matrix (cr, &matrix);
+      cairo_matrix_translate (&matrix,
+                              allocation.width / 2,
+                              allocation.height / 2);
 
       cairo_save (cr);